<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="UTF-8">
		<title>闭包</title>
	</head>
	<body>
		<h1>闭包：定义在一个函数内部的函数</h1>
		
		<script type="text/javascript">
			function f1(){
				var n=10;//没有释放
				function f2(){
					
					n++;
					document.write("n======="+n);
					document.write("<br/>");
				}
				return f2;
			}
			
	
		
			var f3=f1();
			
			f3();
			f3();
			f3();
			f3();
		</script>
		
	</body>
</html>
